home *** CD-ROM | disk | FTP | other *** search
/ Group 42-Sells Out! - The Information Archive / Group 42 Sells Out (Group 42) (1996).iso / security / crypt_fa.txt next >
Text File  |  1995-11-18  |  25KB  |  519 lines

  1. Newsgroups: sci.crypt
  2. Path: eternity.demon.co.uk!demon!pipex!uunet!newsgate.watson.ibm.com!yktnews!
  3. admin!wo0z!lwloen
  4. From: lwloen@rchland.vnet.ibm.com (Larry Loen)
  5. Subject: temporary, independent FAQ
  6. Sender: news@rchland.ibm.com
  7. Message-ID: <1992Nov09.152315.20637@rchland.ibm.com>
  8. Date: Mon, 09 Nov 1992 15:23:15 GMT
  9. Reply-To: lwloen@vnet.ibm.com
  10. Disclaimer: This posting represents the poster's views, not necessarily those
  11.  of IBM
  12. Nntp-Posting-Host: wo0z.rchland.ibm.com
  13. Organization: IBM Rochester
  14. Lines: 501
  15.  
  16. "temporary, independent" sci.crypt Frequently Asked Questions
  17.  
  18. There a group is putting together a fine FAQ for this
  19. topic.  However, in my brief tenure on Internet, there seems to
  20. be a consistent cry for some form of FAQ and postings that also
  21. cry for one.  After a discussion with a former member of the
  22. FAQ group, I've decided to post this from time to time.
  23.  
  24. This is an attempt to answer many basic questions in hope of
  25. providing a lot of the benefit of a FAQ without the burden of
  26. being a complete answer to all relevant questions.  There is no
  27. desire or attempt to replace the other group's work; this is more
  28. of a stopgap.  However, beginners should find this very helpful.
  29.  
  30. Note:  References to a "Megabarfoocorp" are intended to be
  31. fictional.
  32.  
  33. Q1:  What is cryptography?  How, basically, does it work?
  34.   What are the basic terms used to describe cryptography?
  35.  
  36.   Cryptography is the art and science of hiding data in plain sight.
  37.   It is also the art and science of stealing data hidden in plain sight.
  38.   There are at least three players.  The first is the one who has
  39.   the original data, which is presumed to have high value to
  40.   others.  This data is presumed to reside in a safe place that
  41.   no one but the originator and his/her friends can see.  (If the
  42.   originator cannot physically secure the original data,
  43.   cryptography is a waste of time).  Now, for cryptography to be
  44.   necessary, the data must, for some reason, have to be
  45.   transmitted over some public means such as a telephone line, a
  46.   letter through the mail; any means that cannot be physically
  47.   secured by the owner to a legitimate receiver of the data.  The
  48.   receiver is the second party.
  49.  
  50.   Cryptography is any transformation of the data into a form it is hoped
  51.   that cannot be recovered in a timely manner by an unknown party,
  52.   which is called here 'the opponent'.  The transformation is not
  53.   some physical means, such as hiding the data on microfilm or
  54.   some such; it is some mathematical transformation of the
  55.   original data that the receiver on the other end knows how to
  56.   undo.
  57.  
  58.   The process of scrambling (transforming) the data is called
  59.   'encryption'.  Unscrambling is called decryption.  An
  60.   encryption system has two basic parts.  1) A general
  61.   transformation process called the encryption algorithm.  2) A
  62.   customization of that algorithm called a cipher key.  The
  63.   sender and the receiver must find a secure means to exchange
  64.   the cipher key.  That is, the same public means used to send
  65.   the encrypted data cannot be used.  This may be a difficult
  66.   problem, and has a variety of solutions, but will be assumed
  67.   solved for now.  Once the key is successfully exchanged, the
  68.   two parties can separately implement the encryption algorithm
  69.   and its inverse, the decryption algorithm.
  70.  
  71.   At this point, the data can be transmitted in its encrypted form
  72.   using the agreed-to key to customize the general algorithm to a
  73.   particular version that transforms the data.  Since the
  74.   encrypted data is sent over some insecure medium, it is assumed
  75.   that an opponent (the third party) may intercept the data,
  76.   possibly without being detected, and analyze the encrypted
  77.   text, also called cipher text.
  78.  
  79.   In theory, any encryption system can be defeated, given enough
  80.   time.  The amount of time it takes cannot always be predicted.
  81.   This is because the opponent can supply extra information
  82.   that might reduce the computation time a great deal.  For one
  83.   thing, the sender and receiver may make a very poor choice of
  84.   cipher key.  If the opponent has a list of poor keys, a
  85.   computer may permit a large list of such keys to be tried;
  86.   if the poor key actually used is on the list, the opponent wins
  87.   even if the encryption system is otherwise secure.
  88.  
  89.   All methods the opponent dreams up have one thing in common.
  90.   It is an attempt to recover the original data without advance
  91.   knowledge of the particular cipher key.  There are a wide
  92.   variety of means available and some will be described later on.
  93.   The name for any of these methods is called 'cryptanalysis' and
  94.   the person who does the penetration is called the cryptanalyst.
  95.  
  96.   In diagram form (the boxes indicated physically secure areas)--
  97.  
  98.   -------------|                   --------------
  99.     Sender     |                   | Receiver
  100.    "x"         |                   |  cipher key
  101.     cipher key |------->  y  ----->|
  102.    y=Encrypt(  |          |        | x=Decrypt(y,key)
  103.       x,key)   |          |        |
  104.   -------------|          |        |-------------
  105.                           V
  106.                   Opponent
  107.                      z = Cryptanalysis(y,Encrypt Algorithm,
  108.                              general knowledge of x, guesses about
  109.                              secret key, statistical analysis of y)
  110.  
  111.            The opponent uses Cryptanalysis of message y until
  112.            the value z is either equal to x or z is "enough" like
  113.            x to accomplish the illicit purpose.  The sender and
  114.            receiver win whenever recovery of z takes too much time.
  115.  
  116. Q2:  I have invented this wonderful, fast-running encryption
  117.   algorithm.  How do I find out if it is as great as I think it
  118.   is?
  119.  
  120.   It is one thousand times easier to invent an encryption
  121.   algorithm than it is to discover if it is worthwhile.  Most
  122.   designers who have not learned cryptography are used to dealing
  123.   with mathematics that discusses the general case.  But,
  124.   successful cryptanalysis often relies on any number of
  125.   fortuitous special cases that the designer must anticipate lest
  126.   a given key and data stream create even one of them.  Many
  127.   practical illicit decryptions astonish the newcomer; they seem
  128.   like cheating, but they do work.
  129.  
  130.   It is easy to get superficial reassurance that a poor
  131.   encryption algorithm seems good.  Most people reading this file
  132.   have probably attempted the kinds of cryptograms one finds in
  133.   newspapers and puzzle books (usually called 'cryptograms').
  134.   That encryption algorithm is simple -- one replaces each letter
  135.   of the alphabet with exactly one other letter of the alphabet.
  136.   In less than an hour, sixth graders have been taught to
  137.   successfully solve this kind of cipher.  Yet, it has 26
  138.   factorial possible keys (about 2 to the 88th power), which is
  139.   much more than the 2 to the 56th keys of the well known
  140.   commercial algorithm, DES.  A large number of keys is
  141.   important, but is not by itself secure.  Obviously, the
  142.   successful sixth graders do not attempt all possible keys.
  143.   They use their general knowledge of English to shortcut the
  144.   process and eliminate all but a few possible keys.
  145.  
  146.   Since the gross mathematical properties of an encryption
  147.   system prove nothing, only cryptanalytic attacks matter
  148.   and these require some study.
  149.  
  150. Q3:  What is an "attack"?
  151.  
  152.   An attack is a particular form of cryptanalysis.  There are
  153.   generic types of attacks, and some very specific attacks.  In
  154.   the end, cryptography is a war of specifics.  The opponent
  155.   will either invent a very clever and unique attack or will
  156.   customize a general attack to suit the needs at hand.  Some
  157.   attacks might even exploit the properties of a particular
  158.   message or settle for a partial illicit decryption.
  159.  
  160.   However, in sci.crypt, there is a great deal of discussion
  161.   about attacks, both general and specific, and an assumption
  162.   that the reader can fill in missing details at times.  Since
  163.   those who post here usually have other things to do, to-the-bit
  164.   details are often omitted.
  165.  
  166. Q4:  Hmm.  In spite of questions 2 and 3, I still think I
  167.   have a pretty good system.  But, it seems pretty hard
  168.   to know if it can really defeat an expert.  Still, I know
  169.   it will work if I can keep my method secret, right?
  170.  
  171.   Good luck.  There are documented cases aplenty where an
  172.   encryption system was deduced based entirely on clever analysis
  173.   of the encrypted text alone.  There are also known cases
  174.   where encryption systems were deduced because the encrypted
  175.   text was later published verbatim somewhere (for instance, a
  176.   press release) and so the system was figured out, eliminating
  177.   the presumed secrecy advantage for the next cipher text.
  178.  
  179. Q5:  What are the principal cryptanalytic attacks?
  180.  
  181.   The first is "cipher text only".  This is recovering the text
  182.   or the key by analysis of the text (using statistical means,
  183.   for instance) and by knowing broad details such as whether it
  184.   is the text of someone's speech, a PC-DOS EXE file, whether text
  185.   is in English or French.  For non-puzzle examples, such broad
  186.   information is almost always reliably known.  People have some
  187.   idea of what they wish to steal.  The weakest systems fall to
  188.   this form of attack.
  189.  
  190.   The next attack is "known plaintext".  If one works with a
  191.   newspaper cryptogram, one may have little idea of what is in
  192.   the text.  However, if one was illicitly trying to decrypt the
  193.   source code of Megabarfoocorp's C++ compiler, one would be much
  194.   better off.  There would be lots of things one could
  195.   confidently expect, such as long strings of the space
  196.   character, strings like "if (" and "if(" and the like.
  197.  
  198.   There would even be whole phrases like "Copyright 1990,
  199.   Megabarfoocorp International" or some such.  With imagination,
  200.   surprisingly long strings can be predicted.  Computers can
  201.   tirelessly try a number of trivial variations of such known
  202.   text at a great many locations.  Knowledge of the encryption
  203.   system may reveal the correct placement outright or a small
  204.   number of places to try.  A wide variety of systems can be
  205.   broken if enough known plaintext can be successfully placed.
  206.  
  207.   The next attack is "chosen plaintext".  In some situations, it
  208.   is possible for the opponent to pose as the legitimate user
  209.   of the encryption system.  This is especially true in "public
  210.   key" systems (described later).  In this case, the opponent
  211.   can present fairly arbitrary unencrypted data of his/her
  212.   choosing, cause it to be encrypted, and study the results.
  213.   Very few systems ever invented pass this test, but it should be
  214.   seriously considered for any significant use.  Why?  No
  215.   designer can dream up all attacks.  Moreover, at some point, a
  216.   form of known plaintext attack may well enough approximate a
  217.   chosen plaintext attack to make it worthwile for the designer
  218.   tot allow for it to begin with, especially as it might not be
  219.   dreamed up by the designer!
  220.  
  221.   There are other attack strategies.  One worth mentioning for
  222.   telecommunications applications is the "replay" attack.
  223.   Suppose one has an Automatic Teller Machine (ATM) which uses a
  224.   substitution cipher.  Since one assumes the telephone line to
  225.   the ATM can be tapped (why encrypt if it cannot?), one can also
  226.   assume the opponent can _inject_ false ciphertext.  Thus,
  227.   without even being aware of the actual system, an opponent may
  228.   be able to simply replay old ciphertext and get the cash drawer
  229.   to give him/her $50 from your account.  There are encryption
  230.   systems which avoid this difficulty.
  231.  
  232.   Another general form of attack often not considered by
  233.   newcomers is comparing multiple messages using the same key.
  234.   It is impractical to use a different key for each cipher
  235.   text (with one important exception called the 'one time
  236.   pad').  Therefore, an opponent will have several different
  237.   texts encrypted in the same key and may be able to exploit
  238.   this fact.  All transpositions algorithms (those which merely
  239.   scramble the order of the bytes) are vulnerable to this
  240.   attack.  More sophisticated systems are also vulnerable to this
  241.   attack in some cases as well.
  242.  
  243.   This is a vast area and one of the things that is difficult,
  244.   even for experienced designers, is anticipation of all possible
  245.   attacks.  Moreover, there is no obligation on the attacker's
  246.   part to be less mathematically sophisticated than the designer.
  247.   A system that survives the attacks the designer invents may
  248.   fall easily to a mathematical approach the designer of the
  249.   system is unfamiliar with.
  250.  
  251.   And, one even has to worry about items like a rare bug in the
  252.   program that injects the cipher key rather than the cipher text
  253.   into the output stream.  It is amazing how often trifling
  254.   errors in the implementation make theory irrelevant.
  255.  
  256. Q6:  What does make a system 'good'?
  257.  
  258.   What makes a system 'good' relies on many details specific to
  259.   a given situation.  Only after a lot of ingenious attacks are
  260.   tried can a system be released for use.  There never can be any
  261.   absolute guarantees.  All that can be said is that it defeated
  262.   the best experts available.  The opponent may be smarter.
  263.  
  264.   However, there are some agreed-to minimums that a good system
  265.   must have to even be worth serious analysis --
  266.  
  267.   1)  It must be suitable for computer use.  Ordinary byte streams
  268.    (as arbitrary as possible) would be the input "plain"
  269.    text and byte streams would be the output "cipher" text.
  270.    There should be few cases where some kinds of input text produces poor
  271.    results and these, if they exist, should be easily known,
  272.    described, and avoided.
  273.  
  274.   2)  To be cost-competitive, it must produce about the same number of
  275.    output cipher bytes as input plain bytes.  Relaxing this restriction
  276.    is not as helpful as one might think; the best historical systems
  277.    meet this restriction, so a new system must meet it also.
  278.  
  279.   3)  Output bytes should have a complex relationship between the key,
  280.    the plain text being encrypted, and possibly some amount of
  281.    text previously encrypted.  "Simple", general methods, such
  282.    as creation/construction of minterm sums and matrix inversions should
  283.    not produce the cipher key or an equivalent, usable illicit
  284.    decryption method.
  285.  
  286.   4)  Trying all keys must not be practical.  Trying a cleverly ordered
  287.    subset of the keys must not work.  This is hard to achieve; it means
  288.    that the failure of a particular key X to illicitly decrypt must
  289.    not also allow an opponent to conclude that some large class of keys
  290.    "similar" to X need not be tried.
  291.  
  292.    All keys must be equally strong; any exceptions must be well
  293.    known, few in number, and easily avoided.
  294.  
  295.   5)  Assume all details about the encryption algorithm are known.
  296.    Relying on a secret method has failed repeatedly.  It is prudent to
  297.    assume only the variable part of the system, called the cipher key,
  298.    that is selected by the customer, is unknown.
  299.  
  300.   6)  Classical attacks must be tried in great variety and ingenuity.
  301.    Details of this are beyond the scope of this file.  For a summary
  302.    of the principal attacks, see Question 5, "What are the principal
  303.    cryptanalytic attacks?".  It is easy to do this particular step
  304.    incompletely.  Remember, there may be little effective limit to the
  305.    resources or the brainpower of one's opponent.  The data may be
  306.    very valuable and it make take only a couple of days rental of the
  307.    right kind of consultant and a supercomputer to get the job
  308.    done.  The legitimate user will, by contrast, have a smaller
  309.    budget that is begrudged as "overhead".
  310.  
  311.   7) Performance must be competitive with existing solutions.  A
  312.    practical problem is that every moment spent encrypting is regarded as
  313.    "overhead".  Therefore, the method must not be uncompetitive
  314.    with existing algorithms regarded as secure.
  315.  
  316.   Inventing one's own system is an interesting pastime and quite
  317.   educational.  However, any hope of really securing data requires, at
  318.   the very minimum, mastery of illicit decipherment.  It is very easy
  319.   to scramble data impressively and please oneself.  This is not
  320.   the same as keeping it actually secure.
  321.  
  322. Q7:  What are the legal restrictions on cryptography?
  323.  
  324.   You'd have to ask a lawyer.  Most governments consider cryptography a
  325.   sensitive topic for one reason or another.  There are a variety
  326.   of restrictions possible.
  327.  
  328.   Most governments don't give their reasons publically, so one
  329.   may not know why there are restrictions, just that there are
  330.   restrictions to follow.
  331.  
  332.   One can expect to find laws about sending encrypted data over national
  333.   borders and may often expect to find laws about the import and export of
  334.   encryption systems.
  335.  
  336.   Since sending data over Internet, Bitnet, Usenet, Fidonet, etc. may cross
  337.   national borders (even if the originator does not realize it), a basic
  338.   familiarity with these laws is recommended before sending out encryption
  339.   systems or encrypted data.
  340.  
  341. Q8:  What is a public key system?
  342.  
  343.   A public key system is an encryption method with a unique
  344.   property -- encryption and decryption use different keys and
  345.   one of those keys can be published freely.
  346.  
  347.   Being able to pass around the 'decrypt' key part of one's
  348.   encryption algorithm allows some very interesting things to
  349.   happen.  For one thing, messages can be exchanged by people who
  350.   had not planned on doing so in advance.  One merely encrypts in
  351.   one's private key, decrypts using the receiver's public key and
  352.   passes on the result to the receiver.  The receiver encrypts in
  353.   his/her own private key, then decrypts using the sender's public
  354.   key, recovering the message.
  355.  
  356. Q9:  What is key distribution?
  357.  
  358.   Key distribution is the practical problem of exchanging keys
  359.   between the parties that wish to set up an encryption system
  360.   between the two of them.  Especially in a network environment,
  361.   passing keys one can trust back and forth, can be difficult.
  362.   How can one be sure a cipher key was not sent by an imposter?
  363.   Unless the keys are exchanged in a secret, secure place,
  364.   face-to-face, getting keys securely exchanged and with
  365.   knowledge of the fact that the key was sent authentically can
  366.   be difficult.  Yet, any practical system must permit reasonably
  367.   convenient, but very secure exchange of cipher keys.
  368.  
  369.   Once a few special keys are securely exchanged, it may be
  370.   possible to send new cipher keys in encrypted form between the
  371.   sender and receiver that have a known lifetime.  That is, the
  372.   cipher key is sent in a special encrypted message using a
  373.   special key used only for exchanging keys.  In
  374.   telecommunications environments, this allows frequent change of
  375.   keys between the parties 'safely' over the same insecure medium
  376.   used to send the cipher text.  While this idea is at the heart
  377.   of much commercial use of cryptography, it is not easily
  378.   accomplished and less easily summarized.
  379.  
  380. Q10:  What is the 'one time pad'?
  381.  
  382.   The 'one time pad' is an encryption method that is known to be
  383.   absolutely, provably secure.  How it works is as follows --
  384.   1.  Generate a huge number of bits using a naturally random
  385.   process.  2.  Both sides exchange this data, which is as much
  386.   data as they are going to exchange later on.  3.  Exclusive OR the
  387.   original text, bit by bit, with the 'one time pad' data, never
  388.   reusing the 'one time pad' data.  4.  Have elaborate rules to
  389.   keep the two sides in synch so that the data can be recovered
  390.   reliably by the receiver.  (Both sides must know where they are
  391.   in terms of how much 'one time pad' has been consumed).
  392.  
  393.   Note that only genuine, naturally random processes will do.  There
  394.   must be no relationship between any prior bit of the 'one time pad'
  395.   and a future bit of the key.  "Random number generators", in
  396.   particular, may not substitute and still be a 'one time pad'.  The
  397.   reason it works is precisely because there is no relationship between
  398.   any bits of the key stream.  All cipher keys are equally probable.
  399.   All original data messages are equally probable.  There is no 'hat'
  400.   to hang analysis upon.  Even if one can inject as much text into
  401.   a one time pad as one wishes, recovering the key stream tells nothing
  402.   about the next message.
  403.  
  404.   Unfortunately, one time pads are very ungainly, so they are not
  405.   typically used.  The requirement to have a genuinely random process,
  406.   with the right kind of statistical probability, is not easy to
  407.   to set up.  The ability to exchange vast amounts of data,
  408.   securely, in advance, is not easy to achieve in environments
  409.   when encryption is needed in the first place.
  410.  
  411.   There are a variety of cipher systems which generate "pseudo
  412.   one time pad" streams of cipher key, but all have the same
  413.   theoretical vulnerability; any algorithmic process introduces
  414.   relationships between some old key bit(s) and the new key bit
  415.   and so permits cryptanalysis.  "Random number generators" are
  416.   frequently dreamed up by newcomers as a "pseudo one time pad",
  417.   but they are notoriously vulnerable to analysis, all
  418.   independent of whether the pseudo-random stream satisfies
  419.   randomness tests or not.
  420.  
  421. Q11:  What is the NSA (National Security Agency)?
  422.  
  423.   The NSA has several tasks.  The most relevant here is that it employs
  424.   the United States' government's cryptographers.  Most nations have some
  425.   department that handles cryptography for it, but the US' NSA tends to
  426.   draw the most attention.  It is considered equal to or superior to any
  427.   such department in the world.  It keeps an extremely low public profile,
  428.   and has a "large", but secret budget.  Because of these and other factors,
  429.   there will be many posts speculating about the activities and motives of
  430.   the NSA.
  431.  
  432. Q12:  What is the American Cryptogram Association?
  433.  
  434.   American Cryptogram Association Information, Sept 1992
  435.  
  436.   The American Cryptogram Association is an international group
  437.   of individuals who study cryptography together and publish
  438.   puzzle ciphers to challenge each other and get practical
  439.   experience in solving ciphers.  It is a nonprofit group.
  440.  
  441.   The American Cryptogram Association (ACA) publishes the
  442.   bi-monthly magazine, "The Cryptogram", which contains
  443.   a wide variety of simple substitution ciphers ("cryptograms")
  444.   in English and other languages as well as cryptograms
  445.   using cipher systems of historical interest (such as Playfair).
  446.  
  447.   The level of difficulty varies from easy to difficult.  Except
  448.   for "foreign language" cryptograms, all text is in English.
  449.  
  450.   The magazine also features "how to" articles at the hobbyist level
  451.   and other features of interest to members.  A "Computer Supplement"
  452.   is also available which features articles on computerizing various
  453.   phases of cryptogram solving; the level of the articles varies from
  454.   simple programming examples to automatic algorithmic solutions of
  455.   various cipher systems.  The supplement is available as a separate
  456.   subscription, and is published when material permits; usually two
  457.   or three times per year.
  458.  
  459.   Where to write for subscription or other information --
  460.  
  461.   ACA Treasurer
  462.   18789 West Hickory St
  463.   Mundelein IL 60060
  464.  
  465. Q13:  What are some good books on cryptography?
  466.  
  467.   Good books on this topic that weren't government classified used
  468.   to be rare.  There are now a host of good books.  One informal
  469.   test of a library's quality is how many of these are on the
  470.   shelves.  These are widely available, but few libraries have
  471.   them all.
  472.  
  473.     David Kahn, The Codebreakers, Macmillan, 1967 [history; excellent]
  474.  
  475.     H. F. Gaines, Cryptanalysis, Dover, 1956 [originally 1939, as
  476.         Elementary Cryptanalysis]
  477.  
  478.     Abraham Sinkov, Elementary Cryptanalysis, Math. Assoc. of Amer.,
  479.         1966
  480.  
  481.     D Denning, Cryptography and Data Security, Addison-Wesley, 1983
  482.  
  483.     Alan G. Konheim, Cryptography:  A Primer, Wiley-Interscience, 1981
  484.  
  485.     Meyer and Matyas, Cryptography:  A New Dimension in Computer Data
  486.         Security, John Wiley & Sons, 1982.
  487.  
  488.   Books can be ordered from Aegan Park Press.  They are not inexpensive,
  489.         but they are also the only known public source for most of these
  490.         and other books of historical and analytical interest.
  491.  
  492.         From the Aegean Park Press P.O. Box 2837, Laguna
  493.         Hills, CA 92654-0837
  494.  
  495.         [write for current catelog].
  496.  
  497.   The following is a quality, scholarly journal.  Libraries may carry it if
  498.      they are into high technology or computer science.
  499.  
  500.      Cryptologia:  a cryptology journal, quarterly since Jan 1977.
  501.         Cryptologia; Rose-Hulman Institute of Technology; Terre Haute
  502.         Indiana 47803 [general: systems, analysis, history, ...]
  503.  
  504.   Thanks to
  505.  
  506.      cme@ellisun.sw.stratus.com (Carl Ellison)
  507.      Gwyn@BRL.MIL (Doug Gwyn)
  508.      smb@ulysses.att.com (Steven Bellovin)
  509.  
  510.   for saving me the trouble of looking up the details on these books and
  511.      publications.
  512.  
  513.  
  514. -- 
  515.    Larry W. Loen        |  My Opinions are decidedly my own, so please
  516.                         |  do not attribute them to my employer
  517.  
  518.  
  519.